<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class Bundler::Source::Git - bundler: Ruby Standard Library Documentation</title>


<script src="../../js/navigation.js" defer></script>
<script src="../../js/search.js" defer></script>
<script src="../../js/search_index.js" defer></script>
<script src="../../js/searcher.js" defer></script>
<script src="../../js/darkfish.js" defer></script>

<script src="../../js/jquery-3.2.0.min.js"></script>

<script src="../../js/vue.min.js"></script>
<script src="../../js/js.cookie.min.js"></script>

<link href="../../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../../css/rdoc.css" rel="stylesheet">
<link href="../../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../../";
  var index_rel_prefix = "../../";
  var darkModeCsseHref = "../../css/rdoc-dm.css"
  var defaultModeCssHref = "../../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../../table_of_contents.html#pages">Pages</a>
    <a href="../../table_of_contents.html#classes">Classes</a>
    <a href="../../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link">Path
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-from_lock">::from_lock</a>
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-3D-3D">#==</a>
    <li ><a href="#method-i-allow_git_ops-3F">#allow_git_ops?</a>
    <li ><a href="#method-i-app_cache_dirname">#app_cache_dirname</a>
    <li ><a href="#method-i-base_name">#base_name</a>
    <li ><a href="#method-i-cache">#cache</a>
    <li ><a href="#method-i-cache_path">#cache_path</a>
    <li ><a href="#method-i-cached-3F">#cached?</a>
    <li ><a href="#method-i-cached_revision">#cached_revision</a>
    <li ><a href="#method-i-cached_revision_checked_out-3F">#cached_revision_checked_out?</a>
    <li ><a href="#method-i-current_branch">#current_branch</a>
    <li ><a href="#method-i-default_glob-3F">#default_glob?</a>
    <li ><a href="#method-i-eql-3F">#eql?</a>
    <li ><a href="#method-i-extension_cache_slug">#extension_cache_slug</a>
    <li ><a href="#method-i-extension_dir_name">#extension_dir_name</a>
    <li ><a href="#method-i-fetch">#fetch</a>
    <li ><a href="#method-i-git_proxy">#git_proxy</a>
    <li ><a href="#method-i-git_scope">#git_scope</a>
    <li ><a href="#method-i-glob_for_display">#glob_for_display</a>
    <li class="calls-super" ><a href="#method-i-has_app_cache-3F">#has_app_cache?</a>
    <li ><a href="#method-i-hash">#hash</a>
    <li ><a href="#method-i-humanized_ref">#humanized_ref</a>
    <li ><a href="#method-i-identifier">#identifier</a>
    <li ><a href="#method-i-include-3F">#include?</a>
    <li ><a href="#method-i-install">#install</a>
    <li ><a href="#method-i-install_path">#install_path</a>
    <li ><a href="#method-i-load_gemspec">#load_gemspec</a>
    <li class="calls-super" ><a href="#method-i-load_spec_files">#load_spec_files</a>
    <li ><a href="#method-i-local-3F">#local?</a>
    <li ><a href="#method-i-local_override-21">#local_override!</a>
    <li ><a href="#method-i-name">#name</a>
    <li ><a href="#method-i-override_for">#override_for</a>
    <li ><a href="#method-i-path">#path</a>
    <li ><a href="#method-i-requires_checkout-3F">#requires_checkout?</a>
    <li ><a href="#method-i-revision">#revision</a>
    <li ><a href="#method-i-serialize_gemspecs_in">#serialize_gemspecs_in</a>
    <li ><a href="#method-i-set_local-21">#set_local!</a>
    <li ><a href="#method-i-shortref_for_display">#shortref_for_display</a>
    <li ><a href="#method-i-shortref_for_path">#shortref_for_path</a>
    <li ><a href="#method-i-specs">#specs</a>
    <li ><a href="#method-i-to_gemfile">#to_gemfile</a>
    <li ><a href="#method-i-to_lock">#to_lock</a>
    <li ><a href="#method-i-to_s">#to_s</a>
    <li ><a href="#method-i-unlock-21">#unlock!</a>
    <li ><a href="#method-i-uri_hash">#uri_hash</a>
    <li ><a href="#method-i-uri_with_specifiers">#uri_with_specifiers</a>
    <li ><a href="#method-i-validate_spec">#validate_spec</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-Bundler::Source::Git">
    <h1 id="class-Bundler::Source::Git" class="class">
      class Bundler::Source::Git
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">



        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-branch" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">branch</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-glob" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">glob</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-options" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">options</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-ref" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">ref</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-submodules" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">submodules</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-uri" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">uri</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-from_lock" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">from_lock</span><span
                                class="method-args">(options)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="from_lock-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 34</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">from_lock</span>(<span class="ruby-identifier">options</span>)
  <span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-string">&quot;uri&quot;</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-string">&quot;remote&quot;</span>)))
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(options)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 12</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">options</span>)
  <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>
  <span class="ruby-ivar">@glob</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;glob&quot;</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">DEFAULT_GLOB</span>

  <span class="ruby-ivar">@allow_cached</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@allow_remote</span> = <span class="ruby-keyword">false</span>

  <span class="ruby-comment"># Stringify options that could be set as symbols</span>
  <span class="ruby-node">%w[ref branch tag revision]</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">k</span>].<span class="ruby-identifier">to_s</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">k</span>] }

  <span class="ruby-ivar">@uri</span>        = <span class="ruby-constant">URINormalizer</span>.<span class="ruby-identifier">normalize_suffix</span>(<span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;uri&quot;</span>] <span class="ruby-operator">||</span> <span class="ruby-string">&quot;&quot;</span>, <span class="ruby-value">:trailing_slash</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-keyword">false</span>)
  <span class="ruby-ivar">@safe_uri</span>   = <span class="ruby-constant">URICredentialsFilter</span>.<span class="ruby-identifier">credential_filtered_uri</span>(<span class="ruby-ivar">@uri</span>)
  <span class="ruby-ivar">@branch</span>     = <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;branch&quot;</span>]
  <span class="ruby-ivar">@ref</span>        = <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;ref&quot;</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;branch&quot;</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;tag&quot;</span>]
  <span class="ruby-ivar">@submodules</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;submodules&quot;</span>]
  <span class="ruby-ivar">@name</span>       = <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;name&quot;</span>]
  <span class="ruby-ivar">@version</span>    = <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;version&quot;</span>].<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string">&quot;-&quot;</span>, <span class="ruby-string">&quot;.pre.&quot;</span>)

  <span class="ruby-ivar">@copied</span>     = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@local</span>      = <span class="ruby-keyword">false</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-3D-3D" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">==</span><span
                                class="method-args">(other)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="Git.html#method-i-eql-3F">eql?</a>
                            </div>
                          </div>

                  <div id="method-i-allow_git_ops-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">allow_git_ops?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="allow_git_ops-3F-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 248</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">allow_git_ops?</span>
  <span class="ruby-ivar">@allow_remote</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@allow_cached</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-app_cache_dirname" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">app_cache_dirname</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="app_cache_dirname-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 236</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">app_cache_dirname</span>
  <span class="ruby-node">&quot;#{base_name}-#{shortref_for_path(cached_revision || revision)}&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cache" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cache</span><span
                                class="method-args">(spec, custom_path = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="cache-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 206</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cache</span>(<span class="ruby-identifier">spec</span>, <span class="ruby-identifier">custom_path</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">app_cache_path</span> = <span class="ruby-identifier">app_cache_path</span>(<span class="ruby-identifier">custom_path</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">feature_flag</span>.<span class="ruby-identifier">cache_all?</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">app_cache_path</span>
  <span class="ruby-identifier">cached!</span>
  <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_rf</span>(<span class="ruby-identifier">app_cache_path</span>)
  <span class="ruby-identifier">git_proxy</span>.<span class="ruby-identifier">checkout</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">requires_checkout?</span>
  <span class="ruby-identifier">git_proxy</span>.<span class="ruby-identifier">copy_to</span>(<span class="ruby-identifier">app_cache_path</span>, <span class="ruby-ivar">@submodules</span>)
  <span class="ruby-identifier">serialize_gemspecs_in</span>(<span class="ruby-identifier">app_cache_path</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cache_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cache_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>This is the path which is going to contain a cache of the git repository. When using the same git repository across different projects, this cache will be shared. When using local git repos, this is set to the local repo.</p>

                              <div class="method-source-code" id="cache_path-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 228</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cache_path</span>
  <span class="ruby-ivar">@cache_path</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">feature_flag</span>.<span class="ruby-identifier">global_gem_cache?</span>
    <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">user_cache</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">bundle_path</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;cache&quot;</span>, <span class="ruby-string">&quot;bundler&quot;</span>)
  <span class="ruby-keyword">end</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;git&quot;</span>, <span class="ruby-identifier">git_scope</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-current_branch" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">current_branch</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="current_branch-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 244</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">current_branch</span>
  <span class="ruby-identifier">git_proxy</span>.<span class="ruby-identifier">current_branch</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-eql-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">eql?</span><span
                                class="method-args">(other)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="eql-3F-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 61</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">eql?</span>(<span class="ruby-identifier">other</span>)
  <span class="ruby-identifier">other</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Git</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">uri</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">uri</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">ref</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">ref</span> <span class="ruby-operator">&amp;&amp;</span>
    <span class="ruby-identifier">branch</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">branch</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">&amp;&amp;</span>
    <span class="ruby-identifier">version</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">version</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">glob</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">glob</span> <span class="ruby-operator">&amp;&amp;</span>
    <span class="ruby-identifier">submodules</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">submodules</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="Git.html#method-i-3D-3D">==</a>
                            </div>

                          </div>

                  <div id="method-i-extension_dir_name" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">extension_dir_name</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="extension_dir_name-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 123</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">extension_dir_name</span>
  <span class="ruby-node">&quot;#{base_name}-#{shortref_for_path(revision)}&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-hash" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">hash</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="hash-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 57</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">hash</span>
  [<span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">ref</span>, <span class="ruby-identifier">branch</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">version</span>, <span class="ruby-identifier">glob</span>, <span class="ruby-identifier">submodules</span>].<span class="ruby-identifier">hash</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-identifier" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">identifier</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="identifier-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 89</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">identifier</span>
  <span class="ruby-identifier">uri_with_specifiers</span>([<span class="ruby-identifier">humanized_ref</span>, <span class="ruby-identifier">cached_revision</span>, <span class="ruby-identifier">glob_for_display</span>])
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-include-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">include?</span><span
                                class="method-args">(other)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="include-3F-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 70</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">include?</span>(<span class="ruby-identifier">other</span>)
  <span class="ruby-identifier">other</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Git</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">uri</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">uri</span> <span class="ruby-operator">&amp;&amp;</span>
    <span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">&amp;&amp;</span>
    <span class="ruby-identifier">glob</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">glob</span> <span class="ruby-operator">&amp;&amp;</span>
    <span class="ruby-identifier">submodules</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">submodules</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-install" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install</span><span
                                class="method-args">(spec, options = {})</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="install-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 187</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install</span>(<span class="ruby-identifier">spec</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:no_install</span>]
  <span class="ruby-identifier">force</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:force</span>]

  <span class="ruby-identifier">print_using_message</span> <span class="ruby-node">&quot;Using #{version_message(spec, options[:previous_spec])} from #{self}&quot;</span>

  <span class="ruby-keyword">if</span> (<span class="ruby-identifier">requires_checkout?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@copied</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">force</span>
    <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">debug</span> <span class="ruby-node">&quot;  * Checking out revision: #{ref}&quot;</span>
    <span class="ruby-identifier">git_proxy</span>.<span class="ruby-identifier">copy_to</span>(<span class="ruby-identifier">install_path</span>, <span class="ruby-identifier">submodules</span>)
    <span class="ruby-identifier">serialize_gemspecs_in</span>(<span class="ruby-identifier">install_path</span>)
    <span class="ruby-ivar">@copied</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">generate_bin_options</span> = { <span class="ruby-value">:disable_extensions</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-operator">!</span><span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">spec_missing_extensions?</span>(<span class="ruby-identifier">spec</span>), <span class="ruby-value">:build_args</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:build_args</span>] }
  <span class="ruby-identifier">generate_bin</span>(<span class="ruby-identifier">spec</span>, <span class="ruby-identifier">generate_bin_options</span>)

  <span class="ruby-identifier">requires_checkout?</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">post_install_message</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-install_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>This is the path which is going to contain a specific checkout of the git repository. When using local git repos, this is set to the local repo.</p>

                              <div class="method-source-code" id="install_path-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 113</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install_path</span>
  <span class="ruby-ivar">@install_path</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
    <span class="ruby-identifier">git_scope</span> = <span class="ruby-node">&quot;#{base_name}-#{shortref_for_path(revision)}&quot;</span>

    <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">install_path</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">git_scope</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="Git.html#method-i-path">path</a>
                            </div>

                          </div>

                  <div id="method-i-load_spec_files" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">load_spec_files</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              
                                <div class="method-calls-super">
                                  Calls superclass method
                                  
                              </div>

                              <div class="method-source-code" id="load_spec_files-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 217</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load_spec_files</span>
  <span class="ruby-keyword">super</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">PathError</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">trace</span> <span class="ruby-identifier">e</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">GitError</span>, <span class="ruby-node">&quot;#{self} is not yet checked out. Run `bundle install` first.&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-local-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">local?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="local-3F-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 252</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">local?</span>
  <span class="ruby-ivar">@local</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-local_override-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">local_override!</span><span
                                class="method-args">(path)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="local_override-21-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 134</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">local_override!</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">local?</span>

  <span class="ruby-identifier">original_path</span> = <span class="ruby-identifier">path</span>
  <span class="ruby-identifier">path</span> = <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-identifier">path</span> = <span class="ruby-identifier">path</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">root</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">path</span>.<span class="ruby-identifier">relative?</span>

  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">branch</span> <span class="ruby-operator">||</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:disable_local_branch_check</span>]
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">GitError</span>, <span class="ruby-node">&quot;Cannot use local override for #{name} at #{path} because &quot;</span> \
      <span class="ruby-string">&quot;:branch is not specified in Gemfile. Specify a branch or run &quot;</span> \
      <span class="ruby-node">&quot;`bundle config unset local.#{override_for(original_path)}` to remove the local override&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">path</span>.<span class="ruby-identifier">exist?</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">GitError</span>, <span class="ruby-node">&quot;Cannot use local override for #{name} because #{path} &quot;</span> \
      <span class="ruby-node">&quot;does not exist. Run `bundle config unset local.#{override_for(original_path)}` to remove the local override&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">set_local!</span>(<span class="ruby-identifier">path</span>)

  <span class="ruby-comment"># Create a new git proxy without the cached revision</span>
  <span class="ruby-comment"># so the Gemfile.lock always picks up the new revision.</span>
  <span class="ruby-ivar">@git_proxy</span> = <span class="ruby-constant">GitProxy</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">options</span>)

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">current_branch</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">branch</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:disable_local_branch_check</span>]
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">GitError</span>, <span class="ruby-node">&quot;Local override for #{name} at #{path} is using branch &quot;</span> \
      <span class="ruby-node">&quot;#{current_branch} but Gemfile specifies #{branch}&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">changed</span> = <span class="ruby-identifier">cached_revision</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">cached_revision</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">revision</span>

  <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:disable_local_revision_check</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">changed</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@unlocked</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">git_proxy</span>.<span class="ruby-identifier">contains?</span>(<span class="ruby-identifier">cached_revision</span>)
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">GitError</span>, <span class="ruby-node">&quot;The Gemfile lock is pointing to revision #{shortref_for_display(cached_revision)} &quot;</span> \
      <span class="ruby-node">&quot;but the current branch in your local override for #{name} does not contain such commit. &quot;</span> \
      <span class="ruby-string">&quot;Please make sure your branch is up to date.&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">changed</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-name" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">name</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="name-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 106</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">name</span>
  <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-ivar">@uri</span>, <span class="ruby-string">&quot;.git&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-path" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">path</span><span
                                class="method-args">()</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="Git.html#method-i-install_path">install_path</a>
                            </div>
                          </div>

                  <div id="method-i-revision" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">revision</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="revision-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 240</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">revision</span>
  <span class="ruby-identifier">git_proxy</span>.<span class="ruby-identifier">revision</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-specs" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">specs</span><span
                                class="method-args">(*)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="specs-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 174</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">specs</span>(<span class="ruby-operator">*</span>)
  <span class="ruby-identifier">set_local!</span>(<span class="ruby-identifier">app_cache_path</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">has_app_cache?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">local?</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">requires_checkout?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@copied</span>
    <span class="ruby-identifier">fetch</span>
    <span class="ruby-identifier">git_proxy</span>.<span class="ruby-identifier">copy_to</span>(<span class="ruby-identifier">install_path</span>, <span class="ruby-identifier">submodules</span>)
    <span class="ruby-identifier">serialize_gemspecs_in</span>(<span class="ruby-identifier">install_path</span>)
    <span class="ruby-ivar">@copied</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">local_specs</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_gemfile" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">to_gemfile</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="to_gemfile-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 49</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_gemfile</span>
  <span class="ruby-identifier">specifiers</span> = <span class="ruby-node">%w[ref branch tag submodules glob]</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">opt</span><span class="ruby-operator">|</span>
    <span class="ruby-node">&quot;#{opt}: #{options[opt]}&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">opt</span>]
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">uri_with_specifiers</span>(<span class="ruby-identifier">specifiers</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_lock" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">to_lock</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="to_lock-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 38</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_lock</span>
  <span class="ruby-identifier">out</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;GIT\n&quot;</span>)
  <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;  remote: #{@uri}\n&quot;</span>
  <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;  revision: #{revision}\n&quot;</span>
  <span class="ruby-node">%w[ref branch tag submodules]</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">opt</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;  #{opt}: #{options[opt]}\n&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">opt</span>]
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;  glob: #{@glob}\n&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">default_glob?</span>
  <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;  specs:\n&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_s" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">to_s</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="to_s-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 77</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_s</span>
  <span class="ruby-keyword">begin</span>
    <span class="ruby-identifier">at</span> = <span class="ruby-identifier">humanized_ref</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">current_branch</span>

    <span class="ruby-identifier">rev</span> = <span class="ruby-node">&quot;at #{at}@#{shortref_for_display(revision)}&quot;</span>
  <span class="ruby-keyword">rescue</span> <span class="ruby-constant">GitError</span>
    <span class="ruby-string">&quot;&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">uri_with_specifiers</span>([<span class="ruby-identifier">rev</span>, <span class="ruby-identifier">glob_for_display</span>])
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-unlock-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">unlock!</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="unlock-21-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 127</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">unlock!</span>
  <span class="ruby-identifier">git_proxy</span>.<span class="ruby-identifier">revision</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;revision&quot;</span>] = <span class="ruby-keyword">nil</span>

  <span class="ruby-ivar">@unlocked</span> = <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-uri_with_specifiers" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">uri_with_specifiers</span><span
                                class="method-args">(specifiers)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="uri_with_specifiers-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 93</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">uri_with_specifiers</span>(<span class="ruby-identifier">specifiers</span>)
  <span class="ruby-identifier">specifiers</span>.<span class="ruby-identifier">compact!</span>

  <span class="ruby-identifier">suffix</span> =
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">specifiers</span>.<span class="ruby-identifier">any?</span>
      <span class="ruby-node">&quot; (#{specifiers.join(&quot;, &quot;)})&quot;</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-string">&quot;&quot;</span>
    <span class="ruby-keyword">end</span>

  <span class="ruby-node">&quot;#{@safe_uri}#{suffix}&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Instance Methods</h3>
                </header>

                  <div id="method-i-base_name" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">base_name</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="base_name-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 304</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">base_name</span>
  <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">%r{^(\w+://)?([^/:]+:)?(//\w*/)?(\w*/)*}</span>, <span class="ruby-string">&quot;&quot;</span>), <span class="ruby-string">&quot;.git&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cached-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cached?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="cached-3F-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 342</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cached?</span>
  <span class="ruby-identifier">cache_path</span>.<span class="ruby-identifier">exist?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cached_revision" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cached_revision</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="cached_revision-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 338</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cached_revision</span>
  <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;revision&quot;</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cached_revision_checked_out-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cached_revision_checked_out?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="cached_revision_checked_out-3F-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 300</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cached_revision_checked_out?</span>
  <span class="ruby-identifier">cached_revision</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">cached_revision</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">revision</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">install_path</span>.<span class="ruby-identifier">exist?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-default_glob-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">default_glob?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="default_glob-3F-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 320</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">default_glob?</span>
  <span class="ruby-ivar">@glob</span> <span class="ruby-operator">==</span> <span class="ruby-constant">DEFAULT_GLOB</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-extension_cache_slug" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">extension_cache_slug</span><span
                                class="method-args">(_)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="extension_cache_slug-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 370</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">extension_cache_slug</span>(<span class="ruby-identifier">_</span>)
  <span class="ruby-identifier">extension_dir_name</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-fetch" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">fetch</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="fetch-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 350</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">fetch</span>
  <span class="ruby-identifier">git_proxy</span>.<span class="ruby-identifier">checkout</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">GitError</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">feature_flag</span>.<span class="ruby-identifier">allow_offline_install?</span>
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">&quot;Using cached git data because of network errors:\n#{e}&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-git_proxy" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">git_proxy</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="git_proxy-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 346</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">git_proxy</span>
  <span class="ruby-ivar">@git_proxy</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">GitProxy</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">cache_path</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">options</span>, <span class="ruby-identifier">cached_revision</span>, <span class="ruby-keyword">self</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-git_scope" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">git_scope</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="git_scope-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 366</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">git_scope</span>
  <span class="ruby-node">&quot;#{base_name}-#{uri_hash}&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-glob_for_display" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">glob_for_display</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="glob_for_display-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 316</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">glob_for_display</span>
  <span class="ruby-identifier">default_glob?</span> <span class="ruby-operator">?</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">:</span> <span class="ruby-node">&quot;glob: #{@glob}&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-has_app_cache-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">has_app_cache?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              
                                <div class="method-calls-super">
                                  Calls superclass method
                                  
                              </div>

                              <div class="method-source-code" id="has_app_cache-3F-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 292</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">has_app_cache?</span>
  <span class="ruby-identifier">cached_revision</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-keyword">super</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-humanized_ref" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">humanized_ref</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="humanized_ref-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 258</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">humanized_ref</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">local?</span>
    <span class="ruby-identifier">path</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">user_ref</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;ref&quot;</span>]
    <span class="ruby-keyword">if</span> <span class="ruby-regexp">/\A[a-z0-9]{4,}\z/i</span>.<span class="ruby-identifier">match?</span>(<span class="ruby-identifier">ref</span>)
      <span class="ruby-identifier">shortref_for_display</span>(<span class="ruby-identifier">user_ref</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">user_ref</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">ref</span>
    <span class="ruby-identifier">ref</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-load_gemspec" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">load_gemspec</span><span
                                class="method-args">(file)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="load_gemspec-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 360</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load_gemspec</span>(<span class="ruby-identifier">file</span>)
  <span class="ruby-identifier">stub</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">StubSpecification</span>.<span class="ruby-identifier">gemspec_stub</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">install_path</span>.<span class="ruby-identifier">parent</span>, <span class="ruby-identifier">install_path</span>.<span class="ruby-identifier">parent</span>)
  <span class="ruby-identifier">stub</span>.<span class="ruby-identifier">full_gem_path</span> = <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">file</span>).<span class="ruby-identifier">dirname</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">root</span>).<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">tap</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">untaint</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">RUBY_VERSION</span> <span class="ruby-operator">&lt;</span> <span class="ruby-string">&quot;2.7&quot;</span> }
  <span class="ruby-constant">StubSpecification</span>.<span class="ruby-identifier">from_stub</span>(<span class="ruby-identifier">stub</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-override_for" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">override_for</span><span
                                class="method-args">(path)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="override_for-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 374</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">override_for</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>.<span class="ruby-identifier">local_overrides</span>.<span class="ruby-identifier">key</span>(<span class="ruby-identifier">path</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-requires_checkout-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">requires_checkout?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="requires_checkout-3F-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 296</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">requires_checkout?</span>
  <span class="ruby-identifier">allow_git_ops?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">local?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">cached_revision_checked_out?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-serialize_gemspecs_in" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">serialize_gemspecs_in</span><span
                                class="method-args">(destination)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="serialize_gemspecs_in-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 272</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">serialize_gemspecs_in</span>(<span class="ruby-identifier">destination</span>)
  <span class="ruby-identifier">destination</span> = <span class="ruby-identifier">destination</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">root</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">destination</span>.<span class="ruby-identifier">relative?</span>
  <span class="ruby-constant">Dir</span>[<span class="ruby-node">&quot;#{destination}/#{@glob}&quot;</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">spec_path</span><span class="ruby-operator">|</span>
    <span class="ruby-comment"># Evaluate gemspecs and cache the result. Gemspecs</span>
    <span class="ruby-comment"># in git might require git or other dependencies.</span>
    <span class="ruby-comment"># The gemspecs we cache should already be evaluated.</span>
    <span class="ruby-identifier">spec</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">load_gemspec</span>(<span class="ruby-identifier">spec_path</span>)
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">spec</span>
    <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">set_installed_by_version</span>(<span class="ruby-identifier">spec</span>)
    <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">validate</span>(<span class="ruby-identifier">spec</span>)
    <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">spec_path</span>, <span class="ruby-string">&quot;wb&quot;</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">to_ruby</span>) }
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-set_local-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">set_local!</span><span
                                class="method-args">(path)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="set_local-21-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 286</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_local!</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-ivar">@local</span>       = <span class="ruby-keyword">true</span>
  <span class="ruby-ivar">@local_specs</span> = <span class="ruby-ivar">@git_proxy</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@cache_path</span>  = <span class="ruby-ivar">@install_path</span> = <span class="ruby-identifier">path</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-shortref_for_display" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">shortref_for_display</span><span
                                class="method-args">(ref)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="shortref_for_display-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 308</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">shortref_for_display</span>(<span class="ruby-identifier">ref</span>)
  <span class="ruby-identifier">ref</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">6</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-shortref_for_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">shortref_for_path</span><span
                                class="method-args">(ref)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="shortref_for_path-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 312</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">shortref_for_path</span>(<span class="ruby-identifier">ref</span>)
  <span class="ruby-identifier">ref</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">11</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-uri_hash" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">uri_hash</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="uri_hash-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 324</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">uri_hash</span>
  <span class="ruby-keyword">if</span> <span class="ruby-regexp">%r{^\w+://(\w+@)?}</span>.<span class="ruby-identifier">match?</span>(<span class="ruby-identifier">uri</span>)
    <span class="ruby-comment"># Downcase the domain component of the URI</span>
    <span class="ruby-comment"># and strip off a trailing slash, if one is present</span>
    <span class="ruby-identifier">input</span> = <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>).<span class="ruby-identifier">normalize</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">%r{/$}</span>, <span class="ruby-string">&quot;&quot;</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-comment"># If there is no URI scheme, assume it is an ssh/git URI</span>
    <span class="ruby-identifier">input</span> = <span class="ruby-identifier">uri</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-comment"># We use SHA1 here for historical reason and to preserve backward compatibility.</span>
  <span class="ruby-comment"># But a transition to a simpler mangling algorithm would be welcome.</span>
  <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span>.<span class="ruby-identifier">sha1</span>(<span class="ruby-identifier">input</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-validate_spec" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">validate_spec</span><span
                                class="method-args">(_spec)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>no-op, since we validate when re-serializing the gemspec</p>

                              <div class="method-source-code" id="validate_spec-source">
            <pre><span class="ruby-comment"># File bundler/source/git.rb, line 358</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">validate_spec</span>(<span class="ruby-identifier">_spec</span>); <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>. </p><p><a href="https://jamesbritt.bandcamp.com/">Hack your world.  Feed your head.  Live curious</a>.</p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

